package org.dbstar.scheduler.job;

import java.util.Map;

import org.dbstar.scheduler.beans.Job;
import org.dbstar.scheduler.beans.JobConf;


/**
 * 构建Job的工厂类基类
 * 
 * @author 代波
 * @since 1.0.0
 * @version 1.0.0
 * @date 2012-5-7
 */
public abstract class AbstractJobFactory<T extends Job> implements JobFactory<T> {
	@Override
	public final T createJob(SchedulerFactory schedulerFactory, JobConf conf, String submitter)
			throws IllegalFactoryException {
		return createJob(schedulerFactory, conf, submitter, null, System.currentTimeMillis());
	}

	@Override
	public final T createJob(SchedulerFactory schedulerFactory, JobConf conf, String submitter, long submitTime)
			throws IllegalFactoryException {
		return createJob(schedulerFactory, conf, submitter, null, submitTime);
	}

	@Override
	public final T createJob(SchedulerFactory schedulerFactory, JobConf conf, String submitter,
			Map<String, String> parameters) throws IllegalFactoryException {
		return createJob(schedulerFactory, conf, submitter, parameters, System.currentTimeMillis());
	}
}
